import request from '@/utils/request'

// 用户列表
export const userList = (data) => {
  return request({
    method: 'POST',
    url: '/sys/user/lists',
    data
  })
}

// 新增
export const userSave = (data) => {
  return request({
    method: 'POST',
    url: '/sys/user/save',
    data
  })
}

// 修改
export const userUpdate = (data) => {
  return request({
    method: 'POST',
    url: '/sys/user/update',
    data
  })
}

// 查询
export const userInfo = (id) => {
  return request({
    method: 'GET',
    url: `/sys/user/info/${id}`
  })
}

// 删除
export const userDelete = (data) => {
  return request({
    method: 'POST',
    url: '/sys/user/delete',
    data
  })
}

// 所有角色
export const allRoles = (params) => {
  return request({
    method: 'GET',
    url: '/sys/role/select',
    params
  })
}
